package com.hnkywl.sts.action.flow.endState;

import com.hnkywl.sts.entity.jhgl.Xy;
import com.hnkywl.sts.entity.organ.Qyjg;
import com.hnkywl.sts.service.jhgl.XyService;
import com.hnkywl.sts.service.organ.QyjgService;
import com.hnkywl.sts.util.ApplicationInstance;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;

/**
 * Created with IntelliJ IDEA.
 * User: Jerry
 * Date: 13-7-23
 * Time: 下午2:33
 * To change this template use File | Settings | File Templates.
 */
public class EndQyjgState implements EventListener {
    @Override
    public void notify(EventListenerExecution execution) throws Exception {
        // 改变状态  ytj--->ysp
        QyjgService qyjgService = ApplicationInstance.createQyjgService();
        Qyjg qyjg = qyjgService.finQyjgDetailByProcessInstance(execution.getProcessInstance().getId());
        qyjg.setZt("ysp");
        qyjgService.updateQyjg(qyjg);
    }
}
